home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / db2eagle.zip / DB2EAGLE.DOC < prev    next >
Text File  |  1993-01-04  |  10KB  |  202 lines

  1. db2eagle.exe is a translator for Clipper/dBASE III syntax to
  2. Eagle syntax. I wrote to facilitate my own conversions.
  3.  
  4. My special thanks goes to John Willis of Willpro Software who
  5. showed me the basics of program translations.
  6.  
  7. db2eagle.exe is written in Quick Basic.  It clears the screen,
  8. and asks for the name of the .prg file without the extension
  9. (must be .prg).  For example: main.prg is entered as main and
  10. creates main.pgm).  It doesn't change the original .prg file but
  11. will overwrite the .pgm file if it already exists without warning.
  12. This is what you would want in most every case anyway.  It 
  13. translates most important commands but NOT every command. It 
  14. does the major work for the main syntax changes that you might
  15. overlook.  It REQUIRES full SYNTAX (i.e. SET PROCEDURE will work
  16. and not SET PROC). This is because 1.) I didn't have time to make
  17. it work and 2.) I never use syntax like CLEA MEMO, since it's hard
  18. to read and a compiler like CLIPPER removes extra syntax anyway.
  19.  
  20. Please note this is a line by line translator and makes no attempt
  21. to figure out your program logic. For example:
  22.  
  23. dBASE III code:                will translate as:
  24.    SELECT B                       *!! SELECT B - needs alias
  25.    USE billing INDEX billdate     USE billing INDEX billdate
  26.    ...                            .
  27.    USE payment INDEX paydate      USE payment INDEX paydate
  28.    ...                            .
  29.    USE                            CLOSE TABLE payment
  30.  
  31. Thus in dBASE III, USE payment will close billing, but in Eagle
  32. you would have to manually add CLOSE TABLE billing since 
  33. translator would miss this syntax. Thus you should manually check
  34. all code, for these hidden syntax changes.  However, you won't 
  35. miss an ENDDO that should be an ENDWHILE, like I used to do.
  36.  
  37. The program is free and can be uploaded to other BBS systems.
  38. As a free product, there is no warranty of any kind. As 
  39. P.L.Olympia always says "it works for me."  It has been tested on
  40. IBM and AST computers with EGA & VGA.  Since it doesn't use color,
  41. it should also work on monochrome monitors. If you are concerned 
  42. about viruses, the original was uploaded on FORUMBOARD's Migent SIG.
  43.  
  44. The only BBS I check regularly is FORUMBOARD.  If you don't yet
  45. belong to it, you should if you are an Eagle programmer. Jordan
  46. Brown who is the author of Eagle regularly answers correspondence
  47. in the Migent SIG.  Try to get this type of support from other
  48. database vendors.
  49.  
  50. You can write to me at:
  51.      James J. Orlowski
  52.      451 West Gonzales Road, #150
  53.      Oxnard, CA 93030
  54.  
  55. Source code is not available, I don't have time to process it.
  56. If a professional software vendor wants to market a cleaned up,
  57. fancier version, make me an offer. For most programmers, this 
  58. version should be good enough.
  59.  
  60. The following syntax is correctly translated by this translator.
  61. Functions:
  62. BOF()       -> BOT()
  63. EOF()       -> EOT()
  64. IIF()       -> IF()
  65. LASTKEY() = 27 -> READKEY() = 271  && Escape key
  66. LASTKEY()   -> READKEY()
  67. REPLICATE() -> char * num
  68. SPACE()     -> ' '  * num
  69. STUFF()     -> REPLACE()
  70.  
  71. * picture translations
  72. NOTE: @ functions are not translated !
  73. 99/99/99 -> 0m/0d/yy
  74. L and Y  -> PICTURE "u" OPTION 't"Yes"f"No"'
  75. 9999.99  -> 4.2  && corrects all decimals properly plus adds
  76.                  OPTIONS "f*" for "*", "f$" for "$", ",+" for ","
  77. 999      -> 3    && all integers are converted to numbers plus adds
  78.                  OPTIONS "f*" for "*", "f$" for "$", ",+" for ","
  79.                  if need string input, you must manually change to 3d
  80. !        -> u
  81. A        -> (ul)
  82. N        -> (uld)
  83. X        -> x
  84.  
  85. Syntax
  86. Removes Additive from: RESTORE FROM ... ADDITIVE
  87.  
  88. Commands
  89. DO WHILE     -> WHILE
  90. ENDDO        -> ENDWHILE
  91. DO CASE      -> SWITCH
  92. ENDCASE      -> ENDSWITCH
  93. NEXT         -> ENDFOR
  94. CLEAR ALL    -> RESET
  95. CLEAR MEMORY -> RESET MEMORY
  96. CLOSE DATABASES -> always adds "SET DATABASE TO database" after this statment
  97. SET PROCEDURE TO procname -> LOAD procname  
  98.                              * also stores procname for UNLOAD procname
  99. CLOSE PROCEDURE -> if haven't previously used SET PROCEDURE TO ... may get:
  100.                    *!!! Eagle Requires Alias to UNLOAD <procedure_name>
  101.                    * UNLOAD ???
  102. GOTO         -> GO
  103. MENU TO memvar -> READ                 && always converts
  104.                   memvar = READGET()   && to these two lines
  105. PACK         -> eliminated since unnecessary in Eagle.
  106. RESTORE SCREEN       -> RESTORE SCREEN FROM tmp_scrn_buf
  107.                         * Note: RESTORE SCREEN FROM is same Clipper & Eagle
  108. SAVE SCREEN          -> SAVE SCREEN TO tmp_scrn_buf
  109. SAVE SCREEN TO image -> SAVE SCREEN image 
  110. SELECT A TO J-> gives *!! SELECT - Needs Alias message
  111. SELECT tablename -> * stores tablename for possible CLOSE TABLE tablename
  112. SET BELL     -> SET BEEP
  113. SET CONSOLE  -> SET DISPLAY
  114. SET DELETED  -> eliminated since unnecessary in Eagle.
  115. SET ESCAPE   -> SET BREAK
  116. SET DEVICE TO PRINT  -> SET OUTPUT TO PRINT
  117. SET DEVICE TO SCREEN -> SET OUTPUT TO SCREEN
  118. SET MARGIN TO        -> SET PRINTER LEFT MARGIN TO
  119. SET MARGIN TO linenum CENTER -> SET MARGIN TO linenum && CENTER
  120.                                 && Eagle currently doesn't support CENTER
  121. SET PRINT ON/OFF -> SET PRINTER ON/OFF
  122. SET RELATION TO fieldname INTO alias -> LINK TO alias by fieldname
  123. ** Problem is SET RELATION TO: needs to be changed to LINK TO alias
  124. ** to unlink relation so translator notes with *!! message here
  125. SET SAFETY   -> eliminated
  126. SET SCOREBOARD -> eliminated
  127. SET COLOR TO dbase_color -> SET COLOR 3 TO eagle_color && dbase_color
  128.                          && eagle colors always written as 1 + 7*16 for B/W 
  129.                          && or 1 + 128 + 7*16 for B*/W for easier deciphering.
  130. USE tablename-> * stores tablename for possible CLOSE TABLE tablename
  131. USE tablename ALIAS aliasname -> * stores aliasname 
  132.                                  * for possible CLOSE TABLE tablename
  133. USE          -> may get if haven't previously used USE or SELECT
  134.                 *!!! Eagle Requires Alias to CLOSE TABLE <alias_name>
  135.                 * CLOSE TABLE ???
  136. ZAP          -> eliminated
  137.  
  138. Conversion Problems - Need Manual Correction
  139. 1.) FIND: only works with one field and not multiple fields, so
  140.     you should probably convert to SEEK.
  141. 2.) PROMPTs need to convert numeric format of CLIPPER to READGET() format
  142. 3.) @ BOX frametop needs to be converted manually.  You might try to
  143.     use my FRAME.BIN uploaded on FORUMBOARD MIGENT SIG if you just
  144.     want to match up corners of single and double lines.
  145. 4.) IF .NOT. EOF() converted to IF .NOT. EOT(), 
  146.     but should check to see if should be changed to 
  147.     a.) IF .NOT. FOUND() or b.) IF .NOT. EXACT()
  148. 5.) String comparisons within Eagle are exact operators with the
  149.     exception that = is inexact and == is exact.
  150.     THUS: SET FILTER TO mcode <> "Z" in CLIPPER which would not allow
  151.                                      code = Z1 must be changed in Eagle TO:
  152.          SET FILTER TO .NOT. mcode = "Z"
  153. 6.) PICTUREs must be converted dealing with @ functions
  154. 7.) Most TRIMs since trim has different meaning in Eagle since it
  155. uses variable length fields.  
  156. 8.) Most SAYs of character data will probably need to use PADR() 
  157. since Eagle uses variable length fields.
  158. 9.) SET COLOR TO U  && Clipper for Underline on monochrome monitors
  159. was not translated since I don't know what it would be in Eagle.
  160.  
  161. No Eagle Equivalent - May Need To Write UDFs or Rewrite Code
  162.  1.) AFILL(), ADEL(), AINS() - Array handling is very different 
  163.      since Eagle requires arrays to be same type (i.e. character,
  164.      numeric, date, etc.) while Clipper is not typed and can mix
  165.      different types within an array.  However, Eagle can have 
  166.      up to 13 dimensions versus 1 for Clipper.  If your array is
  167.      the same type, these can be easily written in UDFs.
  168.  2.) DBEDIT() - no equivalent.  I hope this is eventually added.
  169.  3.) MEMOEDIT() - no equivalent.  Jordan Brown has uploaded 
  170.      SHOW.bin to show a binary field, which is probably the
  171.      read only equivalent of MEMOEDIT().  This can be partially worked
  172.      around by using extensions in binary.bin.
  173.  4.) DELETED() - no equivalent but really this is an advantage
  174.      since NEVER HAVE TO PACK.
  175.  5.) DTOS() - no equivalent but again this is an advantage since
  176.      indexes can use syntax SEEK idnumber, date() and don't have
  177.      to figure out how to convert criteria to string so don't have
  178.      to use convoluted SEEK idnumber + DTOS(date()) as in Clipper.
  179.  6.) FOPEN()/FCLOSE()/FSEEK()/FERROR() - no equivalent for binary files
  180.      but OPEN, CLOSE, etc. in textio.bin can work with text files.
  181.  7.) SET ORDER TO - no equivalent. Since index handling automatic
  182.      you don't have to remember the order but just use SET INDEX TO.
  183.  8.) TEXT...ENDTEXT - no equivalent.  Ask Jordan.
  184.  9.) LOCK commands are supposed to be in the next update so
  185.      exact syntax is unknown at this time.  In most cases, you would
  186.      want to use TRANSACTION BEGIN/COMMIT/ABORT anyway, so you would
  187.      be better off to rewrite it.
  188.  
  189. Not implemented within db2eagle.exe
  190. 1.) SAVESCREEN() & RESTSCREEN() from Clipper not converted
  191. 2.) SEEK: need to change + to ,
  192. 3.) INDEX ON: need to change + to ,
  193. 5.) SETCOLOR() need to change to:
  194.                oldcolor = COLOR(eagle_color_number)
  195.                SET COLOR eagle_color_number TO
  196. 6.) SET FUNCTION <expN> to proc must be converted to
  197.     SET FUNCTION "f2" TO DO proc
  198. 7.) SET KEY TO: not yet implemented within Eagle, if later added
  199.     as part of a future update, it will probably need manual correction
  200.     since Jordan used different key codes than dBASE III/Clipper.
  201. 8.) All other SET commands.
  202.